package com.aabte.springdocopenapi.controller;

import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class ApiException extends RuntimeException {

    protected Integer status;
    protected String code;
    protected String msg;

    public ApiException(Integer status, String code, String msg) {
        this.status = status;
        this.code = code;
        this.msg = msg;
    }

    public ApiException(String message, Integer status, String code, String msg) {
        super(message);
        this.status = status;
        this.code = code;
        this.msg = msg;
    }

    public ApiException(String message, Throwable cause, Integer status, String code, String msg) {
        super(message, cause);
        this.status = status;
        this.code = code;
        this.msg = msg;
    }

    public ApiException(Throwable cause, Integer status, String code, String msg) {
        super(cause);
        this.status = status;
        this.code = code;
        this.msg = msg;
    }

    public ApiException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, Integer status, String code, String msg) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.status = status;
        this.code = code;
        this.msg = msg;
    }
}


